using System;

namespace EOSDigital.SDK
{
	public struct Time
	{
		public int Year;

		public int Month;

		public int Day;

		public int Hour;

		public int Minute;

		public int Second;

		public int Milliseconds;

		public Time(int Year, int Month, int Day)
		{
			this = new Time(Year, Month, Day, 0, 0, 0, 0);
		}

		public Time(int Year, int Month, int Day, int Hour)
		{
			this = new Time(Year, Month, Day, Hour, 0, 0, 0);
		}

		public Time(int Year, int Month, int Day, int Hour, int Minute)
		{
			this = new Time(Year, Month, Day, Hour, Minute, 0, 0);
		}

		public Time(int Year, int Month, int Day, int Hour, int Minute, int Second)
		{
			this = new Time(Year, Month, Day, Hour, Minute, Second, 0);
		}

		public Time(int Year, int Month, int Day, int Hour, int Minute, int Second, int Milliseconds)
		{
			this.Year = Year;
			this.Month = Month;
			this.Day = Day;
			this.Hour = Hour;
			this.Minute = Minute;
			this.Second = Second;
			this.Milliseconds = Milliseconds;
		}

		public static implicit operator DateTime(Time t)
		{
			return new DateTime(t.Year, t.Month, t.Day, t.Hour, t.Minute, t.Second, t.Milliseconds);
		}

		public static implicit operator Time(DateTime t)
		{
			return new Time(t.Year, t.Month, t.Day, t.Hour, t.Minute, t.Second, t.Millisecond);
		}

		public static bool operator ==(Time x, Time y)
		{
			if (x.Year == y.Year && x.Month == y.Month && x.Day == y.Day && x.Hour == y.Hour && x.Minute == y.Minute && x.Second == y.Second)
			{
				return x.Milliseconds == y.Milliseconds;
			}
			return false;
		}

		public static bool operator !=(Time x, Time y)
		{
			return !(x == y);
		}

		public override bool Equals(object obj)
		{
			if (obj is Time)
			{
				return this == (Time)obj;
			}
			return false;
		}

		public override int GetHashCode()
		{
			int num = -2128831035;
			num *= (0x1000193 ^ this.Year.GetHashCode());
			num *= (0x1000193 ^ this.Month.GetHashCode());
			num *= (0x1000193 ^ this.Day.GetHashCode());
			num *= (0x1000193 ^ this.Hour.GetHashCode());
			num *= (0x1000193 ^ this.Minute.GetHashCode());
			num *= (0x1000193 ^ this.Second.GetHashCode());
			return num * (0x1000193 ^ this.Milliseconds.GetHashCode());
		}

		public override string ToString()
		{
			return ((DateTime)this).ToString();
		}
	}
}
